// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose: declaration of CXFormsElementSubmission.
//   $Id$


#pragma once
#include "XFormsElementDefaultImpl.h"
#include "SingleNodeBindingUI.h"
#include "IUIEvents.h"
#include "submission.h"
#include "parseSubmission.h"

#define CXFORMSELEMENTSUBMISSION_EVENTS_LENGTH 3

class CXFormsElementSubmission
	:	public CXFormsElementDefaultImpl<CImplSubmitInfo,CXFormsParseSubmitInfo,CXFormsElementSubmission,CXFormsElementSingleNodeBinding>
//	,public IUISubmissionEvents
{
public:
	CXFormsElementSubmission(void);
	~CXFormsElementSubmission(void);
	virtual HRESULT InitBehaviour();
protected:
	virtual HRESULT render();
private:
	//<summary>
	//	array storing event cookies.
	//	these are the ids given to us by 
	//	RegisterEvent.
	//</summary>
	long m_alEventCookies[CXFORMSELEMENTSUBMISSION_EVENTS_LENGTH];
	//<summary>
	//The event cookies are assigned on an
	//	object-by-object basis, however, 
	//	the names can be static.
	//</summary>
	static const CComBSTR * const sm_asEventNames[CXFORMSELEMENTSUBMISSION_EVENTS_LENGTH];

};
